package com.spsyry.order.controller.api;

import com.spsyry.api.OrderApi;
import com.spsyry.api.vo.NotifyPay2OrderVo;
import com.spsyry.common.core.domain.R;
import com.spsyry.order.domain.Order;
import com.spsyry.order.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class OrderApiController implements OrderApi {

    @Autowired
    private IOrderService iOrderService;

    @Override
    public R createOrder(NotifyPay2OrderVo notifyPay2OrderVo) {
        int count = this.iOrderService.updateOrderID(Order.builder().orderStatus(notifyPay2OrderVo.getStatus()).orderNo(notifyPay2OrderVo.getOrderId()).build());

        log.info("count:"+count);
        return R.ok(count);
    }
}
